package com.adream.scalpel.app.server.domain;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import java.util.Date;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class LoginEvent {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Long eventId;

    @Persistent
    private String username;

    @Persistent
    private Date logInTime;

    public LoginEvent(String username) {
        this.username = username;
        this.logInTime = new Date();
    }

    public Long getEventId() {
        return eventId;
    }

    public Date getLogInTime() {
        return logInTime;
    }

    public String getUsername() {
        return username;
    }

    public void setEventId(Long eventId) {
        this.eventId = eventId;
    }

    public void setLogInTime(Date logInTime) {
        this.logInTime = logInTime;
    }

    public void setUsername(String username) {
        this.username = username;
    }
}
